﻿<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<head>
<title>查询用户订单列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<%=request.getContextPath()%>/style/adminStyle.css" rel="stylesheet" type="text/css" />
<script src="<%=request.getContextPath()%>/js/jquery.js"></script>
<script src="<%=request.getContextPath()%>/js/public.js"></script>
<script type="text/javascript">



function selet(){
	var i=1;
if(Form.accountNumber.value==""|Form.accountNumber.value==null){
	
	 i=0;
	
}
if(i==0){
	 alert("条件不能为空");
	 Form.accountNumber.focus();
	 return false;
}else{
	if(/.*[\u4e00-\u9fa5]+.*$/.test(Form.accountNumber.value)){ 
		alert("不能含有汉字！"); 
		return false; 
		} 
	return true;
}
	



	
}
</script>
</head>
<body>
	<div class="wrap">
		<div class="page-title">
			<span class="modular fl"><i class="order"></i><em>查询用户订单列表</em></span>
		</div>
		<div class="operate">
			<form action="../Administrators/order_list3_1.do"  name="Form">
				<img src="../images/icon_search.gif" /> <input type="text" 
					class="textBox length-long" placeholder="输入用户账号或手机号..." id="accountNumber" name="accountNumber"/> <select
					class="inline-select" id="payment" name="payment">
					<option value="0">未付款</option>
					<option value="1">已付款</option>
				</select> <input type="submit" value="查询" class="tdBtn" onclick="return selet()"/>
			</form>
		</div>
		<table class="list-style Interlaced">
			<tr>
				<th>id</th>
				<th>订单编号</th>
				<th>下单时间</th>
				<th>付费内容</th>
				<th>付费账号</th>
				<th>订单金额</th>
				<th>支付方式</th>
				<th>订单状态</th>
				<th>操作</th>
			</tr>
			<c:forEach items="${order}" var="orderlist">
				<tr>
					<td align="center">${orderlist.id}</td>
					<td align="center" >${orderlist.orderNumber}</td>
					<td class="center"><span class="block">${fn:substring(orderlist.numberDate, 0, 19)}</span>
					</td>

					<c:if test="${orderlist.paidContent==0}">
						<td width="200"><span class="block" align="center">账号充值订单</span>
						</td>
					</c:if>

					<c:if test="${orderlist.paidContent==1}">
						<td width="200"><span class="block" align="center">流年运势订单</span>
						</td>
					</c:if>

					<c:if test="${orderlist.paidContent==2}">
						<td width="200"><span class="block" align="center">爱情婚姻订单</span>
						</td>
					</c:if>

					<c:if test="${orderlist.paidContent==3}">
						<td width="450"><span class="block" align="center">财运测算订单</span>
						</td>
					</c:if>

					<c:if test="${orderlist.paidContent==4}">
						<td width="200"><span class="block" align="center">健康测算订单</span>
						</td>
					</c:if>

					<c:if test="${orderlist.paidContent==5}">
						<td width="200"><span class="block" align="center">事业测算订单</span>
						</td>
					</c:if>

					<c:if test="${orderlist.paidContent==6}">
						<td width="200"><span class="block" align="center">功名测算订单</span>
						</td>
					</c:if>

					<c:if test="${orderlist.paidContent==7}">
						<td width="200"><span class="block" align="center">性格测算订单</span>
						</td>
					</c:if>

					<c:if test="${orderlist.paidContent==8}">
						<td width="200"><span class="block" align="center">周公解梦订单</span>
						</td>
					</c:if>

					<c:if test="${orderlist.paidContent==9}">
						<td width="200"><span class="block" align="center">塔罗牌订单</span>
						</td>
					</c:if>

					<c:if test="${orderlist.paidContent==10}">
						<td width="200"><span class="block" align="center">起名改名订单</span>
						</td>
					</c:if>

					<c:if test="${orderlist.paidContent==11}">
						<td width="200"><span class="block" align="center">紫薇斗数订单</span>
						</td>
					</c:if>

					<c:if test="${orderlist.paidContent==12}">
						<td width="200"><span class="block" align="center">公司测名订单</span>
						</td>
					</c:if>

					<c:if test="${orderlist.paidContent==100}">
						<td width="200"><span class="block" align="center">大师预约订单</span>
						</td>
					</c:if>
					<td width="100"><span class="block" align="center">${orderlist.accountNumber}</span>
						</td>
					<td class="center"><span><i>￥</i><b name="0">${orderlist.money}</b></span>
					</td>
					<td class="center"><span>${orderlist.payments}</span></td>
					<c:if test="${orderlist.payment==0}">
						<td class="center" title="未支付"><span><img src="../images/no.gif"/></span></td>
					</c:if>
					<c:if test="${orderlist.payment==1}">
						<td class="center" title="已支付"><span><img src="../images/yes.gif"/></span></td>
					</c:if>
					
					<td class="center"><a href="../Administrators/order_detail.do?orderNumber=${orderlist.orderNumber}"
						class="inline-block" title="查看订单"><img src="../images/icon_view.gif" /></a> 
							<a href="#" class="inline-block" onclick="javascript:return del(${orderlist.id});"	title="删除订单"><img src="<%=request.getContextPath()%>/images/icon_trash.gif"/></a>
							
					</td>
				</tr>
			</c:forEach>

		</table>
		<!-- BatchOperation -->
		<div style="overflow: hidden;">
			<!-- Operation -->
			<!-- <div class="BatchOperation fl">
				<label for="del" class="btnStyle middle" 
					id="btn1" >全选</label> <input type="button" value="删除订单"
					class="btnStyle" />
			</div> -->
			<!-- turn page -->
			<div class="turnPage center fr">
				<a href="../Administrators/cont4.do?cont=${pages.allSize-1}"
					onclick="return checkFirst1(${pages.allSize-1})">上一页</a> <a>当前：第${pages.allSize}页,共${pages.totalPage}页</a>
				<a href="../Administrators/cont4.do?cont=${pages.allSize+1}"
					onclick="return checkNext1(${pages.allSize+1})">下一页</a>
			</div>
		</div>
	</div>
<script type="text/javascript">


function checkFirst1(id){
    if(id>=1){
      return true;
    }

    alert("已到页首,无法加载更多");
 return false;
}
var tol=${pages.totalPage};
function checkNext1(id){
	  if(id<=tol){
		  return true; 
	  }
    alert("已到页尾，无法加载更多页");
    return false;
    }
    
    
    
function del(id) {
	
	var msg = "您确定要删除吗？\n\n请确认！";
	
	 var sr=${admin.jurisdiction};
	 if(sr!=3){
		 alert("权限不足");
		return false;
	 }else{
			if(confirm(msg)==true){
				$.ajax({
					"url":"${pageContext.request.contextPath}/Administrators/order_delete.do",
					"data":"id="+id,
					"type":"POST",
					"dataType":"json",
					"success":function(obj){

						if(obj.state==1){
							
							window.location="${pageContext.request.contextPath}/Administrators/order_list.do";
							
						}
				
					}});
				
			return true;
			}else{
			return false;
			}
		 
	 }
	

	}
</script>

</body>

</html>